The Pop-11 language is similar to Lisp in power, but with a more
traditional syntax. Pop-11 is the main implementation language of the Poplog
programming environment. The finally version of Pop-11, has been available
since October 1981, and mostly implemented by John Gibson, is much larger and
has far more facilities. It includes all the features of POP-2 and many more.
However, it requires a computer with a large, `flat' address space, well over
a megabyte in size. We correctly predicted in the early 1980s that as the
price of hardware fell, it would soon be possible for computers in the home,
in the office, and in schools to run programs of the size of the Pop-11
system, and larger, providing a very powerful tool for program development, or
for teaching computing. Should people use Pop-11 as a programming language
rather than the better known languages like Basic, Fortran, Pascal, C or C++ ?
The answer is that it depends on what you need the
language for. In some cases the other languages are clearly better. For
example C runs on more machines, and programs written in C will often run
faster and require less space than the same program written in Pop-11.
However, Pop-11 is a richer, more advanced language, which enables more
ambitious programs to be written with less effort. For particularly ambitious
projects, where the problem is very complex and exact nature of the problem is
not well understood in advance, a language like Pop-11 is particularly useful
for the following reasons:
(a) It provides a very rich set of facilities, with a varied range of data-types and control facilities, that can cope with a wide range of types of applications (including those requiring object oriented programming facilities).
(b) Its syntax is extendable so that different sub-languages suited to different sub-problems can easily be implemented within it and integrated with Pop-11 itself.
(c) The Poplog version of Pop-11 comes in an incremental interactive
development environment which can enormously speed up the process of
development, debugging and testing compared with most non-AI programming
languages. For example the incremental compiler allows a new procedure to be
compiled into a system that already contains many
megabytes of
compiled code, in a fraction of a second. That is because the compiling and
linking are all done within the system: the system does not have to be
re-built.
(d) For certain applications (e.g. like a word processor or other interactive tool) the development can be unending in that some users will want to be able to produce their own extensions to the original application. Such software is never complete. I call it "very soft ware". Because Pop-11 uses an incremental compiler which is part of the run-time system, it is possible for an application implemented in Pop-11 to support indefinite extension and tailoring by end-users. For example the Poplog editor VED is implemented in Pop-11 and many users have used that fact to implement their own extensions for a variety of different purposes.
(e) It is available on a variety of Unix platforms and on VAX and Alpha VMS systems, and provides a common interface to the file system and many system calls across these platforms. It can be run on PCs under the Linux operating system (A port to Windows NT is in progress.)
(f) It has a number of unusual features that facilitate certain sorts of
programming. These features include the use of an "open stack" for passing
arguments and results, which makes it
very easy, for example, to
write procedures that take variable numbers of arguments or produce variable
numbers of results, partial application, which supports the construction of
very efficient "closures" and memo-functions, dynamic lists, which implement a
form of lazy evaluation, the process mechanism which supports the modelling of
concurrent systems, the code-planting procedures that support the rapid
development of new immediately portable languages, the choice of dynamic or
lexical scoping of variables (a feature shared with Common Lisp), and the
"dynamic local expression" facility "dlocal", which automatic switching of
environments in different contexts, including "exit actions" for procedures. A
feature that Pop-11 shares with Scheme and many functional languages is that
procedures (functions) are `first class' objects. That is they can not only be
run, but can also be treated like all other data-types, assigned to variables,
stored in data structures, and manipulated in various ways, including
combining them with other data to form new procedures at run time (sometimes
referred to as `closures'. This capability makes possible some very elegant
forms of programs, such as are described (using Scheme) in the well known book
`Structure and Interpretation of Computer Programs' by Abelson and Sussman.
An important feature of Pop-11 is its inherent ability to be used in an
`on-line' mode. This means that commands in the language can be given at any
time: there is no division between a phase in which you specify a program
which is to be compiled, and a phase in which your programs run. You can
interleave additions to the program and commands to run the
program, using the same language and the same running process for
both. Thus you can define a procedure, then run it to test it, then define a
new procedure using the first one, then run it, then define new procedures,
etc. If you find a procedure needs to be changed you can edit it without
leaving Pop-11 and the new version will immediately be available without
re-compiling other procedures or re-linking your program. (Recompilation will
be required if the procedure had been declared as a constant for efficiency.)
To make all this possible Pop-11 contains an `incremental compiler' which is part of the system when programs are running. In most languages the compiler is a separate program which runs to transform your program file into a file called an object file, and then you have to link the object files together with any libraries used, and then finally you can start running the program. Pop-11 (like the other Poplog languages) makes this multi-stage process unnecessary. You can directly compile and run extensions to your program at any time, because the compiler remains a part of the running system.
One feature that Pop-11 shares with many AI language systems, though it is
lacking in Fortran, Pascal, C, Cobol and other widely used languages is the
"garbage collector", or store manager. This is a very important feature of
Pop-11 which enormously simplifies the use of programs that create large
numbers of temporary structures then discard them. It is
also very
complicated because of the need to cope with externally loaded programs using
languages like C that do not have garbage collections.